<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');

    $router->get('/users/analysis','UserController@analysis');  // 用户分析

    $router->get('/users/orders', 'OrderController@orders');    //  用户所属订单列表

    $router->get('/users/checkfinance', 'UserController@checkfinance');     // 检查资金

    $router->get('/users/cash', 'UserController@editFinancePage');
    $router->post('/users/editfinance', 'UserController@editFinance');

    $router->post('/users/lyj', 'UserController@lyj');

    $router->resource('users', UserController::class);

    $router->resource('shops', ShopController::class);

    $router->get('/orders/user','OrderController@userOrder');
    $router->resource('orders', OrderController::class);

    $router->resource('walletlog', WalletlogController::class);

    $router->get('/cash/someone', 'CashController@someone');
    $router->resource('cash', CashController::class);   // 资金提现

    $router->get('city/add/', 'CityController@create');//添加商圈
    $router->resource('city', CityController::class);//商圈

    $router->resource('reserve', TypeReserveController::class);//预定分类设置
    $router->resource('takeout', TypeTakeoutController::class);//外卖分类设置

    /*---------------------------------------------------------商家-----------------------------------------------------------*/
    $router->get('order/detail', 'ShopOrderController@one');//订单详情
    $router->get('shop/oneorder', 'ShopOrderController@shopOrder');//查看某商家订单
    $router->resource('shop/order', ShopOrderController::class);//订单管理

    $router->resource('shop/printer', PrinterController::class);//设备管理

    $router->get('shop/dishes/newcreate', 'DishesController@newcreate');//添加菜式
    $router->resource('shop/dishes', DishesController::class);//菜式管理

    $router->get('shop/menu/create', 'ShopMenuController@create');//添加菜式分类
    $router->resource('shop/menu', ShopMenuController::class);//菜式分类管理

    $router->resource('shop/clerk', ClerkController::class);//员工管理

    $router->resource('shop/apply', ShopApplyController::class);//申请成为商家

    $router->resource('shop/check', ShopCheckController::class);//商家审核

    $router->get('shop/roomtable/newcreate', 'RoomTableController@create');//创建房桌
    $router->resource('shop/roomtable', RoomTableController::class);//房桌管理

    /*---------------------------------------------------------财务-----------------------------------------------------------*/
    $router->get('/cash/someone', 'CashController@someone');
    $router->resource('cash', CashController::class);   // 资金提现记录

    $router->get('infobox', 'InfoBoxController@infoBox');//优惠

    $router->resource('card', CardController::class);   // 充值卡管理

    $router->resource('coupon', CouponController::class);   // 优惠券管理

    $router->resource('cheapen', ShopCheapenController::class);   // 单单立减

});
